/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/
/* 
This file is the Header for the Isp Image Analysis module. 

This File was written as part of HW assignment 1 in the course Introduction
To Systems Programming at Tel-Aviv University's School of Electrical 
Engineering, Winter 2011, by Amnon Drory.
*/
/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/

#ifndef __ISP_IMAGE_ANALYSIS_H
#define __ISP_IMAGE_ANALYSIS_H

/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/

#include "Hw3Types.h"
#include "IspImage.h"

/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/

/**
 * ConvertPixelColorToGrayscale accepts the color value of a pixel and 
 * returns the corresponding gray scale value. 
 *
 * Accepts:
 * -------
 * Red - the Red part of the pixel's color value, in the range 0-255
 * Blue - the Blue part of the pixel's color value, in the range 0-255
 * Green - the Green part of the pixel's color value, in the range 0-255
 *
 * Returns:
 * -------
 * A value in the range 0-255 which is the grayscale value 
 * corresponding to the color of the pixel.
 */ 
Byte_t ConvertPixelColorToGrayscale( Byte_t Red, Byte_t Green, Byte_t Blue );

/**
 * BoxContainsAFace() checks if a rectangular box in an image contains a face.
 *
 * Accepts:
 * -------
 *  I - an Image ( variable of type IspImage )
 *  BoxTop - the index of highest row of the box
 *  BoxLeft - the index of the left-most column of the box.
 *  HeightOfBox - In Pixels
 *  WidthOfBox - In Pixels 
 *	ImageHeight - In Pixels 
 *	ImageWidth - In Pixels  
 *
 * Returns:
 * -------
 * TRUE - if a face was found in the box.
 * FALSE - otherwise
 *
 * Notice: this function might recognize some non-faces as faces (false positives),
 *         and might also fail to recognize some faces (false negatives). However,
 *         it is deterministic, and will always return the same results for the same
 *	       box.
 */ 
BOOL BoxContainsAFace( 
	IspImage I, 
	int BoxTop, 
	int BoxLeft, 
	int HeightOfBox, 
	int WidthOfBox,
	int ImageHeight,
	int ImageWidth );

/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/

#endif /* #ifndef __ISP_IMAGE_ANALYSIS_H */